package com.ztsoft.user.pojo.enums;

/**
 * 结果码集合
 */
public enum ResultCode {

    //成功
    SUCCESS(1000, "操作成功"),

    //1000系列通用错误
    FAILED(1001, "操作失败"),
    VALIDATE_FAILED(1002, "参数校验失败"),
    ERROR(1003, "未知错误"),

    //2000系列用户错误
    USER_EXIST(2000, "用户已存在"),
    ROLE_EXIST(2001, "角色已存在"),
    PERMISSION_EXIST(2002, "权限已存在"),
    ROUTE_EXIST(2003, "路由已存在"),
    NO_PERMISSION(2004, "权限不足,请联系管理员"),

    //3000系列登录验证错误
    USER_NOT_EXIST(3000, "用户不存在"),
    USER_WRONG_PASSWORD(3001, "密码错误"),
    USER_LOGIN_FAIL(3002, "用户名或密码错误"),
    USER_NOT_LOGIN(3003, "用户还未登录,请先登录"),
    UNAUTHENTICATED(3004, "认证不通过"),
    VERIFICATION_CODE_OVERDUE(3005, "验证码已过期"),
    VERIFICATION_CODE_ERROR(3006, "验证码错误"),
    TOKEN_NOT_EXIST(3007, "token不存在"),
    TOKEN_VERIFY_FAIL(3008, "token验证失败"),

    //4000系列数据操作错误
    DATA_REPETITION(4000, "数据重复"),
    DATA_NOT_EXIST(4001, "数据不存在"),
    DATA_MODIFY_FAIL(4002, "数据修改失败"),
    DATA_QUERY_ERROR(4003, "获取数据失败"),
    FILE_DOWNLOAD_FAIL(4004, "文件下载失败"),

    ABNORMAL(1008,"文件下载失败"),
    UNCHANGEABLE(1017, "不可修改他人数据"),
    COMPUTE_MODE(1018, "请选择正确的计算方式"),
    PROJECT_APPROVE(1019, "有未完成项目审批选项"),
    BEFORE_TENDER(1020, "有未完成开标前审批选项"),
    BEFORE_MATCH(1021, "导入文件不匹配"),
    DATA_ERRORS(1022, "导入数据有误"),

    NUMBER_WARNING(1023, "已超过预定的额度"),
    WARNING(1024, "填写信息不完整，请填写需求单位或工程名称、总体匹配时间");

    private int code;
    private String msg;

    public int getCode() {
        return code;
    }

    public void setCode(int code) {
        this.code = code;
    }

    public String getMsg() {
        return msg;
    }

    public void setMsg(String msg) {
        this.msg = msg;
    }

    ResultCode(int code, String msg) {
        this.code = code;
        this.msg = msg;
    }

}